What is differentiable path tracing

The core idea behind differentiable rendering is that rendering a scene is just a function that takes in the scene parameters and outputs an image. If this function can be differentiated, we can calculate how a small perturbation of the parameters would affect the resulting image. Through optimization, we can then adjust these parameters to minimize the difference between the rendered image and a target image. The implementation of and explanation of the differentiable path tracer is based on the following works [1] [2] [3] [4] [5] [6] [7] .

Images

Path tracer

Microfacet BRDF

The path tracer supports multiple material models. The microfacet model is a model that is physically based. The model implemented in this project was based on the Disney Burley 2012 model [8] , with the energy conservation adjustment based on [9] as suggested by [10] .

Microfacet BRDF materials

Bounding Volume Hierarchy

In order to get good performance, this path tracer uses a bounding volume hierarchy (BVH) constructed with the surface area heuristic better split the triangles. A simple example of this this data structure and ho it is generated top down is illustrated in the picture.

Creation of a BVH

Multiple Importance Sampling

The Path tracer has importance sampling methods for the materials and Equirectangular HDR images. This allows it to apply multiple importance sampling (MIS), combining the BRDF samples with the samples from the distant environment light.

Stanford dragon MIS

Scene optimization

The optimization scheme utilized by the differentiable path tracer was predominantly derived from the methodologies outlined in [5] , [6] , and [7] . as the capabilities of this differentiable path tracer listed below, are described in these referenced works.

Recursive Control Variates

Nicolet et al.[7] suggest the use of recursive control variates to decrease the variance of subsequent renders. In essence the control variate leverages information from a correlated render to reduce the error made by the Monte Carlo estimator. Consequently, The control variate is a better estimator compared to the original render.

control variate comparison

Adam optimizer

Gradient Clipping

Gradient Masking

Progressive texture resolution

Multi-view optimization

References

[1] T.-M. Li, M. Aittala, F. Durand, and J. Lehtinen, “Differentiable monte carlo ray tracing through edge sampling,” ACM Trans. Graph. (Proc. SIGGRAPH Asia), vol. 37, no. 6, pp. 222:1–222:11, 2018 [2] D. Azinović, T.-M. Li, A. Kaplanyan, and M. Nießner, “Inverse path tracing for joint material and lighting estimation,” 2019. [3] M. Nimier-David, S. Speierer, B. Ruiz, and W. Jakob, “Radiative backpropagation: An adjoint method for lightning-fast differentiable rendering,” Transactions on Graphics (Proceedings of SIGGRAPH), vol. 39, no. 4, Jul. 2020. [4] D. Vicini, S. Speierer, and W. Jakob, “Path replay backpropagation: Differentiating light paths using constant memory and linear time,” Transactions on Graphics (Proceedings of SIGGRAPH), vol. 40, no. 4, pp. 108:1–108:14, Aug. 2021. [5] M. Nimier-David, Z. Dong, W. Jakob, and A. Kaplanyan, “Material and Lighting Reconstruction for Complex Indoor Scenes with Texture-space Differentiable Rendering,” in Eurographics Symposium on Rendering - DL-only Track, A. Bousseau and M. McGuire, Eds. The Eurographics Association, 2021. [6] T. Zeltner, S. Speierer, I. Georgiev, and W. Jakob, “Monte carlo estimators for differential light transport,” Transactions on Graphics (Proceedings of SIGGRAPH), vol. 40, no. 4, Aug. 2021. [7] B. Nicolet, F. Rousselle, J. Novák, A. Keller, W. Jakob, and T. Müller, “Recursive control variates for inverse rendering,” Transactions on Graphics (Proceedings of SIGGRAPH), vol. 42, no. 4, Aug. 2023. [8] B. Burley and W. D. A. Studios, “Physically-based shading at disney,” in Acm Siggraph, vol. 2012. vol. 2012, 2012, pp. 1–7. [9] S. Lagarde and C. De Rousiers, “Moving frostbite to physically based rendering,” in SIGGRAPH 2014 Conference, Vancouver, 2014 [10] J. Boksansky, “Crash course in brdf implementation,” 2021